
IF EXISTS (SELECT 1 FROM SYSOBJECTS 
			WHERE NAME ='ModuleInfo' AND TYPE = 'U')
DROP TABLE ModuleInfo
GO
CREATE TABLE ModuleInfo
(
	ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
	PID INT NULL,
	Code NVARCHAR(20) NULL,
	[Name] NVARCHAR(50) NULL,
	Detail NVARCHAR(200) NULL,
	Sort INT NULL,
	Link NVARCHAR(50) NULL,
	CreateBy NVARCHAR(20) NULL,
	CreateDate DATETIME NULL
)
GO
IF EXISTS (SELECT 1 FROM SYSOBJECTS 
			WHERE NAME ='ItemInfo' AND TYPE = 'U')
DROP TABLE ItemInfo
GO
CREATE TABLE ItemInfo
(
	ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
	MID INT NULL,
	Title NVARCHAR(50) NULL,
	[Status] INT NULL,
	Body TEXT NULL,
	Author NVARCHAR(20) NULL,
	Keyword NVARCHAR(20) NULL,
	Origin NVARCHAR(50) NULL,
	CreateBy NVARCHAR(20) NULL,
	CreateDate DATETIME NULL
)
GO


INSERT INTO ModuleInfo
SELECT '0','MD1','Politics','Politics',1,'#','admin',GETDATE() UNION ALL
SELECT '0','MD2','Sports','Sports',2,'#','admin',GETDATE() UNION ALL
SELECT '0','MD3','Movies','Movies',3,'#','admin',GETDATE() UNION ALL
SELECT '0','MD4','Obituaries','Obituaries',4,'#','admin',GETDATE() UNION ALL
SELECT '0','MD5','Theater','Theater',5,'#','admin',GETDATE() UNION ALL
SELECT '0','MD6','Science','Science',6,'#','admin',GETDATE() UNION ALL
SELECT '0','MD7','Travel','Travel',7,'#','admin',GETDATE() UNION ALL
SELECT '0','MD8','Television','Television',8,'#','admin',GETDATE() UNION ALL
SELECT '0','MD9','Health','Health',9,'#','admin',GETDATE()
GO
INSERT INTO ItemInfo
SELECT '1','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '1','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '1','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '2','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '2','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '3','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '4','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '4','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '4','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '5','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '5','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '6','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '6','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '6','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '7','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '7','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '8','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '8','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '8','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '9','test test  test','1','test','admin','test',NULL,'admin',GETDATE() UNION ALL
SELECT '9','test test  test','1','test','admin','test',NULL,'admin',GETDATE()
GO